package com.xyb.controller;

import com.xyb.config.WS_CourseChartRoomServer;
import com.xyb.entity.Message;
import lombok.NonNull;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("course")
public class WS_CourseChartRoomController {
    @Resource
    private WS_CourseChartRoomServer courseChartRoomServer;

    @PostMapping("/{courseId}/{userId}")
    public void getIds(@PathVariable("courseId") @NonNull Long courseId,@PathVariable("userId") @NonNull Long userId, @RequestBody Message msg) {
        msg.setCourseId(courseId);
        msg.setUserId(userId);
        courseChartRoomServer.sendMessage2CourseById(msg);
    }
}
